#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int a, b, first, second, max, min;
	scanf("%d%d", &a, &b);
	if (a > b)
	{
		max = a;
		min = b;
	}
	else {
		max = b;
		min = a;
	}
	first = max % 10;
	second = min * min;
	printf("%d %d", first, second);
	return 0;
}